package com.mystudy.springcloud.service;


import com.mystudy.springcloud.dao.AccountDao;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

@Service
@Slf4j
public class AccountService {
	@Autowired
	AccountDao accountDao;

	/**
	 * @功能: 扣减余额  已用余额 + money | 可用余额 - money
	 * @作者: 高志红
	 */
	public void decreaseAccount(Long userId, BigDecimal money) {
		log.info("---------------------> 开始扣减余额 <---------------------");
		accountDao.decreaseAccount(userId, money);
		log.info("---------------------> 扣减余额完成 <---------------------");
	}
}